package com.atguigu.gulimall.product.entity;

import com.atguigu.gulimall.product.vaild.AddGroup;
import com.atguigu.gulimall.product.vaild.ListValue;
import com.atguigu.gulimall.product.vaild.UpdateGroup;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.TableLogic;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.*;

/**
 * <p>
 * 品牌
 * </p>
 *
 * @author szh
 * @since 2020-12-01
 */
@Data
@EqualsAndHashCode(callSuper = false)
public class PmsBrand implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 品牌id
     */
    @TableId(value = "brand_id", type = IdType.AUTO)
//    @Null(message = "新增的时候，id必须为空",groups = {AddGroup.class})
//    @NotNull(message = "修改的时候，id不能为空",groups = {UpdateGroup.class})
    private Long brandId;

    /**
     * 品牌名
     */
//    @NotBlank(message = "品牌名不能为空")
    private String name;

    /**
     * 品牌logo地址
     */
//    @NotNull
//    @URL(message = "品牌logo必须是一个url地址")
    private String logo;

    /**
     * 介绍
     */
    private String descript;

    /**
     * 显示状态[0-不显示；1-显示]
     */
//    @NotNull
//    @ListValue(vals = {0,1})
    @TableLogic(value = "1",delval = "0")
    private Integer showStatus;

    /**
     * 检索首字母,一个字符，太长会抛异常
     */
//    @NotNull
//    @Pattern(regexp = "^[a-zA-Z]$",message = "检索首字母,必须是一个字符，")

    private String firstLetter;

    /**
     * 排序
     */
//    @NotNull
//    @Min(value = 0,message = "排序必须大于等于0")
    private Integer sort;


}
